package fhp.hlhj.giantfold.adapter
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import de.hdodenhof.circleimageview.CircleImageView
import fhp.hlhj.giantfold.R
import fhp.hlhj.giantfold.javaBean.ShakeRedListBean
import fhp.hlhj.giantfold.network.Urls
import fhp.hlhj.giantfold.utils.MyUtils
import java.util.ArrayList

/**
 * Created by Administrator on 2018\2\5 0005.
 */
class ShakeRedListAdp(private val layoutId:Int,private val datas:ArrayList<ShakeRedListBean.DataBean>):BaseQuickAdapter<ShakeRedListBean.DataBean,BaseViewHolder>(layoutId,datas) {
    override fun convert(helper: BaseViewHolder?, item: ShakeRedListBean.DataBean?) {
        helper?.setText(R.id.tvRate,MyUtils.formatDouble(item?.annual_rate!!.toDouble(),2)+"%")
        val view = helper?.getView<CircleImageView>(R.id.itemIcon)
        helper?.setText(R.id.itemName,item?.nick_name)
        Glide.with(mContext).load(Urls.BaseUrl+"/"+item?.savepath+item?.savename).dontAnimate().into(view)
    }
}